package fhp.hlhj.giantfold.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.makeramen.roundedimageview.RoundedImageView
import fhp.hlhj.giantfold.R
import fhp.hlhj.giantfold.javaBean.MessageListBean
import fhp.hlhj.giantfold.network.Urls

/**
 * author: FHP
 * data: on 2017\11\28 0028 14:08
 * E-Mail: 103945089@qq.com
 */
class ActiveMessageListAdp(layoutId:Int,data:List<MessageListBean.DataBean>) : BaseQuickAdapter<MessageListBean.DataBean,BaseViewHolder>(layoutId,data) {

    override fun convert(helper: BaseViewHolder?, item: MessageListBean.DataBean?) {
        helper?.setText(R.id.itemTitle,item?.title)
        helper?.setText(R.id.itemInfo,item?.message)
        helper?.setText(R.id.tvTime,item?.sent_time)
        val itemimg = helper?.getView<RoundedImageView>(R.id.itemImg)
        Glide.with(mContext).load(Urls.BaseUrl+item?.savepath+item?.savename).asBitmap().dontAnimate().placeholder(R.mipmap.placeholdericon).into(itemimg)
    }
}